package aobing;

public class RunnableTest implements Runnable {

    static int count;

    @Override
    public synchronized void run() {
        for(int i = 0;i < 10000;i++){
            count++;
        }
    }

    public static void main(String[] args) throws InterruptedException {
        Thread thread = new Thread(new RunnableTest());
        thread.start();
        thread.join();
        System.out.println("count = " + count);
        Thread thread1 = new Thread(() -> {
            while (true) {
                System.out.println("我是后台线程");
            }
        });
//        thread1.setDaemon(true);
        thread1.start();
    }
}
